home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / System / BoingBag1 / Contributions / Workbench / AslSizePatch / mymacros.h < prev   
C/C++ Source or Header  |  1999-09-15  |  1KB  |  55 lines

  1. #ifndef MYMACROS_H
  2. #define MYMACROS_H
  3.  
  4. /*                      Support stuff                   */
  5. #ifndef REG
  6. #ifdef _DCC
  7. #define REG(x) __ ## x
  8. #else
  9. #define REG(x) register __ ## x
  10. #endif
  11. #endif
  12.  
  13. #ifndef ASM
  14. #if defined __MAXON__ || defined __STORM__ || defined _DCC
  15. #define ASM
  16. #else
  17. #define ASM __asm
  18. #endif
  19. #endif
  20.  
  21. #ifndef SAVEDS
  22. #ifdef __MAXON__
  23. #define SAVEDS
  24. #endif
  25. #if defined __STORM__ || defined __SASC
  26. #define SAVEDS __saveds
  27. #endif
  28. #if defined _GCC || defined _DCC
  29. #define SAVEDS __geta4
  30. #endif
  31. #endif
  32.  
  33.  
  34. /*                      Miscellaneous                   */
  35. #ifndef MAX
  36. #define MAX(x,y) ((x) > (y) ? (x) : (y))
  37. #endif
  38.  
  39. #ifndef MIN
  40. #define MIN(x,y) ((x) < (y) ? (x) : (y))
  41. #endif
  42.  
  43.  
  44. /*                      MUI related                     */
  45. #define METHOD(name)        ULONG name( struct IClass *cl, Object *obj, struct opSet *msg )
  46. #define METHOD2(name,data)  ULONG name( struct IClass *cl, Object *obj, struct data *msg )
  47.  
  48. #define DISPATCHER(name)    ULONG SAVEDS ASM name( REG( a0 ) struct IClass *cl, REG( a2 ) Object *obj, REG( a1 ) Msg msg ) { switch( msg->MethodID ) {
  49. #define ENDDISP             return( DoSuperMethodA( cl, obj, msg )); }
  50.  
  51. #define CALLM(name)         case MUIM_##name: return( name( cl, obj, (APTR)msg ))
  52. #define CALLM2(method,name) case method: return( name( cl, obj, (APTR)msg ))
  53.  
  54. #endif
  55.